export function sortBySortNumber<T extends { sortNumber: number }>(datas: T[]) {
  return datas.sort((a1, a2) => (a1.sortNumber || 0) - (a2.sortNumber || 0))
}

export interface OptionItem {
  label: string
  value: string
}
export function optionsToMap(options: OptionItem[]) {
  const map: Record<string, string> = {}
  options.forEach(item => {
    map[item.value] = item.label
  })
  return map
}
